<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<title>子账号登录</title>
		<link rel="stylesheet" href="../css/common.css">
		<link rel="stylesheet" href="../css/page.css">
		<script src="../js/jquery-3.2.1.min.js"></script>
		<script src="../js/media.js"></script>
		<script src="../js/common.js"></script>
		<style>
			.father_store{
				background: #FFF;
			}
			.father_store span{
				float: left;
				width: 50%;
				height: 0.56rem;
				padding: 0.08rem;
				text-align: center;
				line-height: 0.4rem;
				box-sizing: border-box;
			}
			.father_store span img{
				width: 0.4rem;
				height: 0.4rem;
			}
		</style>
	</head>
	<body>
		<!--头部-->
		<div class="public-header flex">
			<!--<span class="public-header-left-search"></span>-->
			<span class="public-header-left-back"></span>
			<span class="public-header-center">子账号登录</span>
			<span class="public-header-right">管理子账号</span>
		</div>
		<!--正文-->
		<div class="Sub-account-login bc-gray">
			<img src="../img/子账号登录@2x.png" alt="">
			<h2>子账号</h2>
			<p class="p t1">可管理店铺</p>
			<p class="p t2">暂无可管理店铺</p>
			<div class="father_store clearfix father_store_clone" style="display: none;">
				<span><img src="../img/denglu.png"></span>
				<span class="store_name">店铺的名称</span>
			</div>
		</div>
	</body>
	<script>
		$('.public-header-right').click(function() {
			//alert('管理子账号');
			window.location.href= './Authorized-account-management.html';
		})
		$.ajax({
			type:"post",
			url:base_url+"ZITAOHUI/store/findStoreAuxiliaryList",
			async:true,
			data:{
				"userId":sessionStorage.u_id
			},
			success:function(data){
				if(data.code == 1){
					for(var i=0;i<data.extend.store_list.length;i++){
						var clone = $('.father_store_clone').clone(true);
						clone.find('img').attr('src',data.extend.store_list[i].store_image);
						clone.find('.store_name').text(data.extend.store_list[i].store_name);
						$('.t2').hide();
						clone.data('store_id',data.extend.store_list[i].store_id);
						clone.show().appendTo($('.Sub-account-login'));
					}
				}else{
					
				}
			}
		});
		$('.father_store_clone').click(function(){
			console.log('店铺的store_id:'+$(this).data('store_id'));
			sessionStorage.s_id = $(this).data('store_id');
			window.location.href = '../wode/Sellers-center.html?is_son=true';
		})
	</script>
</html>